from datetime import datetime
a='2018-10-08'
b='2018/10/08'
d1=datetime.strptime(a,'%Y-%m-%d').strftime('%Y%m%d')
d2=datetime.strptime(a,'%Y-%m-%d')
d3=datetime.strptime(b,'%Y/%m/%d')
d4=datetime.strptime(b,'%Y/%m/%d').strftime('%Y%m%d')
print(d1,'\n',d2,'\n',d3,'\n',d4)